{template header}

<link href="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>

<div class="container">


<div class="panel panel-default">
  <div class="panel-body">


<div class="row">
  <div class="col-md-2"></div>
  <div class="col-md-8">
  
  
<form id='form1' method="POST" action="{SITE_URL}index.php?app=plan&ac=add&ts=do"  enctype="multipart/form-data">

  <div class="form-group">
    <label>名称：</label>
    <input name="title" type="text" class="form-control">
  </div>
  
  
  {if $arrType}
  <div class="form-group">
    <label>类型：</label>

<select class="form-control" name="typeid">
{loop $arrType $key $item}
<option value="{$item[typeid]}">{$item[typename]}</option>
{/loop}
</select>
  </div>
  {/if}

  <div class="form-group">
    <label>方案详情{if $draft==''}<a class="btn btn-xs" href="{php echo(curPageURL())}&draft=1">恢复丢失内容</a>{/if}</label>
    <p>请至少插入一张图片，最后一张默认为封面</p>
    <div id="tseditor"></div>
    <div style="display: none;">
      <textarea id="content" name="content"></textarea>
    </div>
    <!--<textarea name="content" id="tseditor"></textarea>-->
  </div>



<div class="form-group">
  <input class="btn btn-success" type="submit" value="发布方案">
</div>

  
</form>
  
  
  </div>
  <div class="col-md-2"></div>
</div>

</div>
</div>



</div>


<script>
  $(function(e){
    $('#form1').on('submit', function(e) {
      var title  = $('#title').val();
      var content  = $('#content').val();


      if(title==''){
        bootbox.alert('名称必填');
        return false;
      }

      if (content == '<p><br></p>') {
        bootbox.alert('内容不能为空');
        return false;
      }


    });


  });


  $('#limitTime').datetimepicker({
    language:  'zh-CN',
    format: 'yyyy-mm-dd hh:ii'
  });
</script>

{php doAction('tseditor')}
{template footer}